package com.fdb.efp.nls.service.common.rules.apply;

import com.fdb.efp.nls.service.common.rules.CheckRule;
import com.fdb.basic.framework.core.constant.EsbRetCodeStandard;
import com.fdb.basic.framework.core.exception.BizException;
import com.fdb.efp.nls.service.vo.sx.NlsCreditInfoVO;

/**
 * 需求编号:2019D08--
 * 问题编号:
 * 开发人员: caoxin
 * 创建日期:2019/12/4
 * 功能描述:
 * 修改日期:2019/12/4
 * 修改描述:
 */
public class CreditPrdInfoIncorrectRule implements CheckRule {
    private NlsCreditInfoVO nlsCreditInfoVO;
    private String prdCode;
    private String prdName;

    public CreditPrdInfoIncorrectRule(NlsCreditInfoVO nlsCreditInfoVO, String prdCode, String prdName) {
        this.nlsCreditInfoVO = nlsCreditInfoVO;
        this.prdCode = prdCode;
        this.prdName = prdName;
    }

    @Override
    public void check() throws BizException {
        if (!prdCode.equals(nlsCreditInfoVO.getPrdCode()) || !prdName.equals(nlsCreditInfoVO.getPrdName())) {
            throw new BizException(EsbRetCodeStandard.WFJKYWGZ.getValue(), "用信与授信产品不一致!");
        }
    }
}
